package gnssio

import (
	"dgo/goutils/utils"
)

type TransmitterListener struct {
	channelid string
	center    *utils.SubscribeCenter
	tag       interface{}
}

func NewTransmitterListener(center *utils.SubscribeCenter, channelid string, tag interface{}) *TransmitterListener {
	rval := &TransmitterListener{
		channelid: channelid,
		center:    center,
		tag:       tag,
	}
	return rval
}

/*
*

	on input
*/
func (this *TransmitterListener) OnReceive(sender I_Comm, buf []byte, len int) {
	this.center.DispatchData(this.channelid, this, buf[:len], this.tag)
}

func (this *TransmitterListener) OnConnect(sender I_Comm) {

}

func (this *TransmitterListener) OnDisconnect(sender I_Comm) {

}
